//
//  LayoutNavigationBar.swift
//  新浪微博
//
//  Created by 陈飞宇 on 2020/10/10.
//

import UIKit

class LayoutNavigationBar: UINavigationBar {
    override func layoutSubviews() {
        super.layoutSubviews()
        
        for subview in subviews {
            let subName = NSStringFromClass(subview.classForCoder)
            if subName == "_UIBarBackground" {
                subview.frame = bounds
            }else if subName == "_UINavigationBarContentView" {
                var frame = subview.frame;
                frame.origin.y = is_X_Seris ? 44 : 20
                frame.size.height = self.bounds.size.height - frame.origin.y;
                subview.frame = frame;
            }
        }
    }
}
